
<template>
  <view class="content">
    <text style="font-size: 50rpx;">子组件B</text>
   
   
    
    <view class="comb_box">
      
      <input 
        type="text" 
        v-model="inputCallBackValue" 
        placeholder="请输入回传值" 
      />
    </view>
  
    <view class="comb_box">
      <text>当前回传值：</text>
      <text style="font-weight: bold; color: green;">{{ inputCallBackValue }}</text>
    </view>
 
    <view>
      <button type="primary" @click="sendBack">回传</button>
    </view>
  </view>
</template>

<script>
export default {
  name: 'comB',
  props: {
    compAValue: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      inputCallBackValue: '默认回传值' 
    }
  },
  methods: {
    sendBack() {
      
      this.$emit('callBackFun', this.inputCallBackValue)
    }
  }
}
</script>

<style scoped>

.content {
  padding: 20rpx;
  border: 2rpx solid #ccc;
  margin: 20rpx 0;
  border-radius: 10rpx;
}
.comb_box {
  margin: 20rpx 0;
}
button {
  margin-top: 20rpx;
}
</style>